#include "step.h"

Step::Step(){

}



StepReset::StepReset(){
    type = 0;
}


StepSyringe::StepSyringe(int idx, int direct, double speed, double posi, double actualSpeed) :
            speed(speed), direct(direct), posi(posi){
    this->idx = idx;
    this->type = 1;
    if(actualSpeed==-100){
        this->actualSpeed = speed*2;
    }else{
        this->actualSpeed = actualSpeed;
    }
}
StepValve::StepValve(int idx, bool state) :
            state(state){
    this->type = 2;
    this->idx = idx;
}

StepWheel::StepWheel(int posi, int direct, int speed) :
            posi(posi), direct(direct), speed(speed){
    this->type = 3;
}
StepHat::StepHat(){
    this->type = 4;
}
StepDetector::StepDetector(bool state){
    this->type = 5;
    this->state = state;
}


QString StepReset::stepPrinter(){
    return "[Reset]";
}

QString StepSyringe::stepPrinter(){
    return QString("[Syringe]") + (direct==1?"Push":"Pull") + QString::number(idx);
}
QString StepValve::stepPrinter(){
    return QString("[Valve]") + (state?"Open":"Close") + QString::number(idx);
}
QString StepWheel::stepPrinter(){
    return QString("[Wheel]") + QString::number(posi);
}
QString StepHat::stepPrinter(){
    return QString("[AddHat]");
}
QString StepDetector::stepPrinter(){
    return QString("[Detector]") + QString(state?"Open":"Close");
}
